<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								企业名称：<input type="text" name="companyName"/>
							</li>

							<li>
								机构代码：<input type="text" name="companyOrgNum"/>
							</li>

							<li>
								手机号：<input type="text" name="companyPhone"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:companyandpc:add">-->
					<!--<i class="fa fa-plus"></i> 添加-->
				<!--</a>-->
				<!--<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:companyandpc:edit">-->
					<!--<i class="fa fa-edit"></i> 修改-->
				<!--</a>-->
				<!--<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:companyandpc:remove">-->
					<!--<i class="fa fa-remove"></i> 删除-->
				<!--</a>-->
				<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:companyandpc:export">-->
						<!--<i class="fa fa-download"></i> 导出-->
				 <!--</a>-->
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:companyandpc:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:companyandpc:remove')}]];
        var prefix = ctx + "system/companyandpc";

        $(function() {
            // var pcId = $("#pcId").val();
            // var phone = $("#companyPhone").val();
            // pcId= parseInt(pcId);
            var options = {
                url: prefix + "/companyAndPcList",
                createUrl: prefix + "/add",
                updateUrl: "/system/people/dept/{id}",
                removeUrl: prefix + "/remove",
				applyUrl: prefix + "/apply",
				exportUrl: prefix + "/export",
				search:false,
				showRefresh:false,
				showColumns:false,
				showToggle:false,
				showSearch:false,
				showExport: false,
				showDropdown:false,
                modalName: "审核",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'companyId', 
					title : '编号',
					visible: false
				},
				{
					field : 'companyName', 
					title : '企业名称',
					sortable: true
				},
				{
					field : 'companyOrgNum', 
					title : '机构代码',
					sortable: true
				},
				{
					field : 'companyAddress', 
					title : '详细地址',
					sortable: true
				},
				{
					field : 'companyApplyTime', 
					title : '申请返回时间',
					sortable: true
				},
				{
					field : 'companyPhone', 
					title : '手机号',
					sortable: true
				},
                 {
					field : 'pcId',
					title : '批次ID',
					sortable: true
				 },
				{
					field : 'applyStatusOne',
					title : '复工审批',
					sortable: true
				},
                    // {
                    //     field : 'applyStatusTwo',
                    //     title : '二级审批',
                    //     sortable: true
                    // },
				// {
				// 	field : 'updateBy',
				// 	title : '更新者',
				// 	sortable: true
				// },
				// {
				// 	field : 'updateTime',
				// 	title : '更新时间',
				// 	sortable: true
				// },
				// {
				// 	field : 'remark',
				// 	title : '备注',
				// 	sortable: true
				// },
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
						actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editWindow(\'' + row.pcId + '\',\'' + "/system/people/dept/" + '\',\'' + "人员详情" + '\')"><i class="fa fa-edit"></i>查看</a> ');
						if(!row.applyStatusOne||row.applyStatusOne=="已提交") {
							actions.push('<a class="btn btn-info btn-xs' + removeFlag + '" href="#" onclick="$.operate.apply(\'' + row.pcId + ',' + row.companyPhone + '\')"><i class="fa fa-remove"></i>通过审核</a>');
						}
                        if(!row.applyStatusOne||row.applyStatusOne=="已提交") {
                            actions.push('<a class="btn btn-info btn-xs ' + removeFlag + '" href="#" onclick="$.operate.unapply(\'' + row.pcId + ',' + row.companyPhone + '\')"><i class="fa fa-remove"></i>不通过审核</a>');
                        }
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>